﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Wicresoft.RDW.Presentation;
using Wicresoft.RDW.Model;
using Wicresoft.RDW.Helper;
using Resources;

namespace Wicresoft.RDW.Calendar
{
    public partial class View : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                InitialDropDownList();
                this.IntialCulture();
            }

        }

        private void IntialCulture()
        {
            this.lbl_year.Text = Resources.NameResource.VisitYear;
            this.lbl_month.Text = Resources.NameResource.VisitMonth;
            this.labApprovedSign.Text = Resources.NameResource.Approved;
            this.labCancelled.Text = Resources.NameResource.Cancelled;
            this.labClosed.Text = Resources.NameResource.Closed;
            this.labCompleted.Text = Resources.NameResource.Completed;
            this.labMouseDesc.Text = Resources.NameResource.ViedDetail;
            this.labSignDesc.Text = Resources.NameResource.ApplyColorSign;
            this.btnApply.Text = Resources.NameResource.IWantToApply;
        }
        private void InitialDropDownList()
        {
            IList<object> year = new List<object>();
            for (int i = 2011; i < 2021; i++)
            {
                year.Add(new { Year = i });
            }
            this.ddlYear.DataSource = year;
            this.ddlYear.DataBind();

            var time = DateTime.Now;
            this.ddlYear.SelectedValue = time.Year.ToString();

            IList<object> month = new List<object>();
            for (int i = 1; i < 13; i++)
            {
                month.Add(new { Month = i });
            }
            this.ddlMonth.DataSource = month;
            this.ddlMonth.DataBind();
            this.ddlMonth.SelectedValue = time.Month.ToString();

        }
        protected void btnApply_Click(object sender, EventArgs e)
        {
            Response.Redirect("/Request/Apply.aspx");
        }

    }
}